package com.atxwq.shop.manager.controller;

import com.atxwq.shop.manager.serivce.ProductUnitService;
import com.atxwq.shop.model.entity.base.ProductUnit;
import com.atxwq.shop.model.vo.common.Result;
import com.atxwq.shop.model.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 商品单元框的控制层
 * @Date 2025/5/15 09:56
 * @Created by 12336
 */

@RestController
@RequestMapping()
public class ProductUnitController {

    @Autowired
    private ProductUnitService productUnitService;

    /**
     * 查询所有商品单元框
     * @return
     */
    @GetMapping("findAll")
    public Result<List<ProductUnit>> findAll(){
        List<ProductUnit> list = productUnitService.findAll();
        return Result.build(list, ResultCodeEnum.SUCCESS);
    }



}
